<style>
    .search-group {
        display: none;
        border: 1px solid #EEEEEE;
        padding: 20px;
        margin-bottom: 15px;
    }
    .search-item {
        display: block!important;
        margin: 10px 0px;
    }
</style>
<div class="search-group">
    <form id="search-form" class="form-inline" action="{$_searchUrl}" method="get">
    {peter:foreach exp="$_searchList as $_search"}
        <div class="form-group search-item">
            <label>{$_search.title}</label>
            <input name="{$_search.name}" type="{$_search.type}" class="form-control">
            {notempty name="$_search.desc"}
            <span>({$_search.desc})</span>
            {/notempty}
        </div>
    {/peter:foreach}
        <div class="form-group search-item">
            <button type="submit" class="form-control btn btn-default">确定</button>
            <button type="button" id="search-close" class="form-control btn btn-default">关闭</button>
        </div>
    </form>
</div>
<button id="search" type="button" class="btn btn-primary">搜索</button>
<script>
    (function () {
        $('#search').on("click",function () {
            $('.search-group').show(500);
        });
        $('#search-close').on("click",function () {
            $('.search-group').hide(500);
        });
        var form = $('#search-form');
        var action = form.attr('action');
        var index = action.indexOf('?');
        if(index > -1) {
            var args = action.substr(index + 1);
            args = args.split('&')
            $(args).each(function(){
                var arr = this.split('=');
                var name = arr[0];
                var value = arr[1];
                $("<input type='hidden' name='"+name+"' value='"+value+"'>").appendTo(form);
            });
        }

    })();

</script>